﻿// -------------------------------------------------------------------------------------------------
// <copyright file="JobRole.cs" company="HeterogeneousComputing.com">
// Creative Commons Attribution-ShareAlike 3.0 Unported License
// </copyright>
//
// <author>Jock</author>
//
// <date>05/08/2011</date>
//
// <summary>Implements the job role class</summary>
// -------------------------------------------------------------------------------------------------
namespace TheTVDBScraper
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Runtime.Serialization; 
    using System.Text;

    /// -------------------------------------------------------------------------------------------------
    /// <summary>   A Job or Role a Person plays.  </summary>
    /// <remarks>    The class author was Jock, on the 05/08/2011. </remarks>
    /// -------------------------------------------------------------------------------------------------
    [DataContract(Name = "JobRole",
        Namespace = "http://www.heterogeneouscomputing.com/TheTVDBScraper", IsReference = true)]
    public abstract class JobRole
    {
        #region Private Fields
        /// <summary> The Person who plays this JobRole. </summary>
            private Person person;
        #endregion

        #region Constructor

            /// -------------------------------------------------------------------------------------------------
            /// <summary>   Initializes a new instance of the JobRole class for a specific Person. </summary>
            /// <param name="person">   The person who undertakes this JobRole. </param>
            /// -------------------------------------------------------------------------------------------------
            public JobRole(Person person)
            {
                this.person = person;
            }

            /// -------------------------------------------------------------------------------------------------
            /// <summary>   Initializes a new instance of the JobRole class and a new instance
            /// of the Person class and associates the two. </summary>
            /// <param name="personName">   Name of the associated person to create. </param>
            /// -------------------------------------------------------------------------------------------------
            public JobRole(string personName)
            {
                this.person = new Person(personName);
                this.person.AddJobRole(this);
            }

            /// -------------------------------------------------------------------------------------------------
            /// <summary>   Initializes a new instance of the JobRole class. </summary>
            /// -------------------------------------------------------------------------------------------------
            public JobRole()
            {
            }
        #endregion

        #region Public Properties

            /// -------------------------------------------------------------------------------------------------
            /// <summary>   Gets or sets the Person who undertakes this JobRole. </summary>
            /// <value> The person. </value>
            /// -------------------------------------------------------------------------------------------------
            public Person Person
            {
                get
                {
                    return this.person;
                }

                set
                {
                    this.person = value;
                }
            }

            /// -------------------------------------------------------------------------------------------------
            /// <summary>   Gets or sets the name of the Persion associated with this JobRole. </summary>
            /// <value> The Persons name. </value>
            /// -------------------------------------------------------------------------------------------------
            [DataMember]
            public string Name
            {
                get
                {
                    return this.Person.Name;
                }

                set
                {
                    this.Person.Name = value;
                }
            }
        #endregion
    }
}

/// -------------------------------------------------------------------------------------------------
// End of JobRole.cs
/// -------------------------------------------------------------------------------------------------
